package servlets;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.*;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;	

import repository.GenericConector;

import com.mysql.jdbc.Statement;
	
public class SeleccionarModificarReserva  extends HttpServlet{


		protected void doPost(HttpServletRequest req, HttpServletResponse resp)
				throws ServletException, IOException {

			try
		{
			String idReserva = req.getParameter("reservaId");//paquete.
			
			GenericConector c = new GenericConector();
			ResultSet Dat = c.getDatosReserva(idReserva);
			while(Dat.next()) 
			{ 	
				req.setAttribute("idpqt" ,Dat.getString(1));
				req.setAttribute("idvuelo" ,Dat.getString(2));
				
			} 
			
			
			req.setAttribute("idreserva", idReserva); // This will be available as ${message}
			req.getRequestDispatcher("/Views/Reservas/ModificarPaso2.jsp").forward(req, resp);
			}
	
			catch(Exception e)
			{
				req.getRequestDispatcher("/Views/Reservas/Index.jsp").forward(req, resp);
			
		}
		}
			

}
